#include<bits/stdc++.h>
using namespace std;
int n,r,a[100010],b[100010];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    for(int i = 0;i < n;i++)
    {
        cin>>r;
        a[r]++;
    }
    if(a[1] + a[2] == n)
    {
        cout<<(n - min(a[1],a[2]));
        return 0;
    }
    for(int i = 1;i <= 100000;i++)
    {
        if(i == 1) continue;
        b[i] = a[i - 1] + b[i - 1];
        b[i] -= min(a[i],b[i]);
    }
    cout<<(a[100000] + b[100000]);
    return 0;
}
